/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wwcontrolserver.controls;

import java.io.Serializable;

/**
 *
 * @author Michael Ferry
 */
public class OnOffControlState extends AbstractControlState implements Serializable{
    public static final boolean DefaultCentralTimerNotficationState = true;
    public static final boolean DEFAULT_CONTROL_STATE = true;
    protected boolean ControlActivation;
    private static final long serialVersionUID = 4991652672817691175L;
    
    
    public OnOffControlState(int ControlID, String ControlName, boolean ControlActivation){
        super(ControlID,ControlName,DefaultCentralTimerNotficationState);
        this.ControlActivation = ControlActivation;
    }
    public boolean GetControlActivation(){
        return ControlActivation;
    }
    @Override
    protected void UpdateControlState(AbstractControlState AbstractState) throws Exception{
        if(AbstractState instanceof OnOffControlState){
            OnOffControlState DesiredState = (OnOffControlState) AbstractState;
            this.ControlActivation = DesiredState.ControlActivation;
        }else{
            throw new Exception();
        }
    }
    @Override
    protected void SetOffState(){
        this.ControlActivation = false;
    }
}
